package com.ruoyi.wechat.controller;

import com.ruoyi.wechat.domain.DictData;
import com.ruoyi.wechat.domain.vo.AjaxResult;
import com.ruoyi.wechat.service.IDictDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 全局字典接口
 * </p>
 *
 * @author YinHeng
 * @since 2024/3/3
 */
@RestController
@RequestMapping("/dict")
public class DictDataController {

    @Autowired
    private IDictDataService dictDataService;

    @GetMapping("/map")
    public AjaxResult dictMap() {
        Map<String, List<DictData>> dictMap = dictDataService.dictMap();
        return AjaxResult.success(dictMap);
    }
}
